<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="A simple HTML5 Template">
<meta name="author" content="dron">
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="shortcut icon" href="/favicon.ico">
<script src="../addons/cut_zongzi/template/mobile/images/jquery-1.11.1.min.js?{php echo time();}"></script>

<link rel="stylesheet" href="../addons/cut_zongzi/template/mobile/images/jquery.remodal.css?{php echo time();}">
<link rel="stylesheet" href="../addons/cut_zongzi/template/mobile/images/index.css?{php echo time();}">

<!-- <script src="http://libs.baidu.com/jquery/1.9.1/jquery-1.11.1.min.js"></script> -->


<title>切粽子HTML5网页版游戏</title>
</head>
<body>
{if $judge['require'] && $judge['subscribe']['subscribe'] == 0}

<div name="subscribe" style="position:absolute;width:100%;height:200px;left:0;top:30%;z-index:999;zoom:1;text-align:center;">
	<h5 style="background-color:white;width:200px;margin:auto;">请先关注后再玩游戏</h5>
	{if empty($judge['thumb'])}
	<img style="width:360px;height:200px;" src="../addons/cut_zongzi/template/mobile/images/asdf.gif">
	{else}
	<img style="width:360px;height:200px;" src="{php echo tomedia($judge['thumb']);}">
	{/if}
</div>
{else}
<div id="extra"></div>

<em> -- Fruit Ninja -- </em>
<em> The game is developed by the Baidu JS team, </em>
<em> we provide the source in git: https://github.com/ChineseDron/fruit-ninja </em>
<em> follow me on weibo http://weibo.com/baidujs </em>
<em> or learn more, to see http://tangram.baidu.com </em>
<canvas class="view" width="400" height="480">
	
</canvas>
<div id="billboard" class="view" style="display:none;background-color:white;text-align:center;padding-top:20%;">
	  <h1>英雄榜</h1>
	  <div style="position:relative;height:70%;width:100%;text-align:center;">
	  <table style="position:relative;width:100%;text-align:center;">
	  	<thead>
	  		<th style="text-align:center;">玩家</th>
	  		<th style="text-align:center;">得分</th>
	  	</thead>
	  	<tbody id="result">
	  		
	  		
	  	</tbody>
	  </table>
	 
	  </div>
	   <div>
	  	<p id="cur_score">您当前得分：<span></span></p>
	  	<p id="score">您最高成绩：<span></span></p>
	  	<p id="top_score">最高记录：<span></span></p>
	  </div>
	  <br>
	 <!--  <a class="remodal-confirm" href="javascript:playagain();">再玩一次</a>
	  <a class="remodal-confirm" href="javascript:share();">分享给朋友</a>
	  <button class="remodal-confirm" id="test">test</button> -->
	 
</div>
<div id="share" class="view" style="display:none;background-color:gray;text-align:center;padding-top:20%;z-index:999999999;">
	
	<img src="../addons/cut_zongzi/template/mobile/images/guide.png"/>
	<a class="remodal-confirm"  href="javascript:close();">关闭</a>
	<a class="remodal-confirm"  href="javascript:close();">知道了</a>
</div>

<div id="desc">
<div style="text-align:center;clear:both;">
<!-- <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script> -->
<!-- <script src="/follow.js" type="text/javascript"></script> -->
</div>
	<div>水果忍者网页版，由<a href="http://weibo.com/baidujs" target="_blank">百度 JS 小组</a>倾情提供</div>
	<div id="browser"></div>
</div>
<!-- <script src="scripts/all.js"></script> -->
<script src="{$_W['siteroot']}addons/cut_zongzi/template/mobile/scripts/all.js?{php echo time();}"></script>
{/if}
<script>
	
	var inst = $("[data-remodal-id=modal2]").remodal();
	function close(){
		jQuery('#share').hide();
	}
   	function playagain(){
   		jQuery('#billboard').hide();
   	}
   	function share(){
   		jQuery('#share').show();
   	}
	function test(res){
		// alert(res);
		// inst.open();
		
		jQuery.ajax({
			url:"{php echo $this->createMobileUrl('billboard',array());}",
			data:{score:res,openid:"{php echo $judge['subscribe']['openid'];}"},
			type:'post',
			dataType:'json',
			success:function(result){
				// alert('当前得分'+result.cur_score+';您的最高纪录：'+result.score+'最高纪录：'+result.top_score);
				jQuery('#cur_score').find('span').text(result.cur_score);
				jQuery('#score').find('span').text(result.score);
				jQuery('#top_score').find('span').text(result.top_score);
				jQuery('#result').html(result.billboard);
			},
			error:function(){
				alert('ajax error');
			}
		});
		jQuery('#billboard').show();

	}
	
</script>


<script src="../addons/cut_zongzi/template/mobile/images/jquery.remodal.js?{php echo time();}"></script>
<script type="text/javascript">
	jQuery(function(){
		jQuery('#test').click(function(){
			alert('hi');
		});
	});
</script>
</body>
</html>
